//计算字符串中的字符数
#include "stdio.h"

int main(int argc, char const *argv[]) {
  int stringLength(const char *string);

  printf("Length of \"stringLength test\" is %i.\n", stringLength("stringLength test"));
  printf("Length of \"\" is %i.\n", stringLength(""));
  printf("Length of \"complete\" is %i.\n", stringLength("complete"));
  return 0;
}

int stringLength(const char *string){
  const char *cptr = string;
  while (*cptr) {
    ++cptr;
  }
  return cptr - string;
}
